<form method="post" id="frmSearch" action="<?= base_url() ?>alumni/index/">
    <div style="text-align: center;vertical-align: middle;">
        <select name="ddAngkatan" id="ddAngkatan">
            <option value="">Semua Angkatan</option>
            <? foreach (getAngkatan() as $k => $v): ?>
                <option value="<?= $v->angkatan_year ?>"<?= $v->angkatan_year == $ddAngkatan ? ' selected="selected"' : "" ?>><?= $v->angkatan_name ?></option>
            <? endforeach; ?>
        </select>
        <input type="text" name="txtSearch" id="txtSearch" value="<?= @$txtSearch ?>"/>
        <input type="submit" class="btn-primary" value="Cari"/>
    </div>
</form>
<table class="table table-bordered table-striped responsive-utilities">
    <thead>
        <tr>
            <th>Nama</th>
            <th>Angkatan</th>
            <th>Jenkel</th>
            <th>Status</th>
            <th>Email</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <? if (@$alumni) : ?>
            <? foreach ($alumni as $k => $v) : ?>
                <tr>
                    <td><?= $v->mpa_fullname ?></td>
                    <td><?= getAngkatanName($v->mpa_graduate_year) ?></td>
                    <td><?= $v->up_gender == "L" ? "Laki-laki" : "Perempuan" ?></td>
                    <td><?= getStatus($v->up_status) ?></td>
                    <td><?= $v->up_email ?></td>
                    <td>
                        <a href="<?= base_url() ?>alumni/rpassword/<?= $v->mpa_id_alumni ?>">Reset Password</a>
                        |  <a href="<?= base_url() ?>alumni/lock/<?= $v->mpa_id_alumni ?>/<?= @$v->ua_islocked ?>"><?= @$v->ua_islocked == "1" ? "Unlock" : "Lock" ?></a>
                    </td>
                </tr>
            <? endforeach; ?>
            <? if ($this->paginationpopup->create_links() <> "") : ?>
                <tr>
                    <th colspan="6" style="text-align: center;"><?php echo $this->paginationpopup->create_links(); ?></th>
                </tr>
            <? endif; ?>
        <? else : ?>
            <tr>
                <td colspan="6">Tidak ada data yang tersedia</td>
            </tr>
        <? endif; ?>
    </tbody>
</table>
<div class="modal hide fade" id="free"></div>
<script>
    function pageClick(page){
        var action = $("#frmSearch").attr("action");
        $("#frmSearch").attr("action", action + page);
        $("#frmSearch").submit();
    };
    
</script>